<?php
require_once 'common/Dao.php';
require_once 'common/db.php';

$file = fopen('/raw.txt', 'r');
if(!$file) exit("exit");

$i = 0;
while (!feof($file)) {
	$line = fgets($file);
	$i ++;
	if($i==7) break;
}

$arr1 = explode("|", $line);

$c = count($arr1);
$c = $c-2;
$c1 = $c+1;

$arr = array();
for ($i = 1; $i < $c1; $i++) {
	$arr[] = $arr1[$i];
}

for ($i = 0; $i < $c; $i++) {
	$arr[$i] = trim($arr[$i]);
}

echo "c = ", $c;

$db = Db::init();

$vls = implode(',', $arr);
//$ret = $db->query('insert into system set(id,name,status,update_time,system_code,account_regist_url,user_regist_url,admin_login_url) values ('. $vls .')');
//$a = $db->lastInsertId();
echo 'l = ' . $a;
print_r($arr);


mysql_connect('localhost', 'root', '');


